#include "viewer.hpp"



viewer::~viewer()
{
}

void viewer::show_tracker(Frame & last, Frame & now){
    // 先显示第一帧的特征点的提取情况
    cv::Mat show_last,show_now;
    
    cvtColor(last.pic, show_last, cv::COLOR_GRAY2BGR);
    cvtColor(now.pic, show_now, cv::COLOR_GRAY2BGR);

    for(int j = 0; j < tracker.prev_pts.size(); j++){
        circle(show_last, tracker.prev_pts[j], 2, cv::Scalar(0, 0, 120), -1);
    }
    

    for(int j = 0; j < tracker.cur_pts.size(); j++){
        if(tracker.mv_idsAndtrackNum[j].second >= 2)
            circle(show_now, tracker.cur_pts[j], 3, cv::Scalar(0, 0, 120), -1);
        else
            circle(show_now, tracker.cur_pts[j], 2, cv::Scalar(0, 120, 0), -1);
        
    }
    //cv::imshow("last all keyPoints", show_last);
    cv::imshow("now all keyPoints", show_now);
    cv::waitKey(0);
}